package com.buaa.music;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    public static final int PLAY = 1;
    public static final int PAUSE = 2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void play(View view) {
        Intent intent = new Intent("music");
        intent.putExtra("action",PLAY);
        startService(intent);
    }

    public void pause(View view) {
        Intent intent = new Intent("music");
        intent.putExtra("action",PAUSE);
        startService(intent);
    }
}
